<template>
    <div>
      <table border="1" align="center">
        <tr v-for="g in good">
<!--          <td v-if="g.id/2===0" style='color: #42b983'>{{ g.name }}</td>-->
          <td v-if="g.id%2===0" style='background-color: #42b983'>{{ g.name }}</td>
          <td v-else>{{ g.name }}</td>
          <td v-if="g.id%2===0" style='background-color: #42b983'>{{ g.price }}</td>
          <td v-else>{{ g.price }}</td>
        </tr>
      </table>
    </div>
</template>

<script>
    import axios from 'axios'
    export default {
        name: "Index",
        data(){
          return{
            good:[]
          }
        },
        mounted() {
          axios({
            url:'http://127.0.0.1:8000/app1/Index/',
            method:'GET'
          }).then(res=>{
            this.good = res.data['good']
          })
        }
    }
</script>

<style scoped>

</style>
